var _divId = "";

$(document).ready(function () {
    window.onscroll = function () {
        //初始情况下不执行
        if (_divId !== "") {
            var tab = $("#griptop");
            if (scrollside(_divId)) {
                tab.removeClass("title_scroll_display");
                tab.addClass("title_scroll");
            } else {
                tab.removeClass("title_scroll");
                tab.addClass("title_scroll_display");
            }
        }
    }
});

function scrollside(divId) {
    this._divId = divId;

    var scrollheight = $(window).scrollTop();
    var tabheight = $("#" + _divId).offset().top;

    console.log(scrollheight, tabheight);
    return (scrollheight > tabheight) ? true : false;
}